package com.iworkh.spring.web.mvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * ViewController
 *
 * @author: iworkh-沐雨云楼
 * @date: 2019-12-31
 */
@Controller
@RequestMapping("/springmvc")
public class ViewController {

    @RequestMapping("/testView")
    public String testView(Model model){
        System.out.println("iworkhView...");
        model.addAttribute("name", "iworkh--xx");
        // 与视图对象的 id 一致
        return "iworkhView";
    }

    @RequestMapping("/testI18n")
    public String testI18n(Model model){
        System.out.println("testI18n...");
        model.addAttribute("name", "iworkh--沐雨云楼");
        return "success";
    }

}
